import { request } from '@umijs/max';

// 请求采购列表
export async function queryPurchaselist(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchaselist', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 采购订单批次列表
export async function queryPurchasecalList(params: any, options?: { [key: string]: any }) {
  return request('/purchase/purchasecalllist', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
    ...(options || {}),
  });
}

// 新增采购单
export async function addPurchase(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchaseadd', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 新增采购单对应的批次
export async function addPurchaseall(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchasecalladd', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 删除批次
export async function delPurchasecall(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchasecalldelete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 删除采购订单
export async function delPurchase(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchasedelete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 采购订单列表修改
export async function updatePurchase(body: any, options?: { [key: string]: any }) {
  return request('/purchase/purchaseupdate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

// 生成订单号
export async function queryOrdernumber(body: any, options?: { [key: string]: any }) {
  return request('/erpgenerateordernumber/ordernumber', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}



